#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> pii;

int func(int x) {
    if(x == 1) return 1;
    int t = sqrt(x);
    if(t * t == x) {
        return 1 + func(t);
    }else{
        return func(t);
    }
}

void solve() {
    int n = 1000;
    map<int, int> mp;
    for(int i = 1; i <= n; i++) {
        mp[func(i)]++;
        if(func(i) == 2) {
            cout << i << endl;
        }
    }
    for(auto [k, v] : mp ){
        cout << k << ' ' << v << endl;
    }
}

signed main() {
    int t = 1;
    while(t--) solve();
    return 0;
}